package com.example.music.service;

import com.example.music.mapper.MusicMapper;
import com.example.music.model.Music;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MusicService {
    @Autowired
    MusicMapper musicMapper;
    public int insert(String title, String singer, String time, String url,int
            userid){
        return musicMapper.insert(title,singer,time,url,userid);
    }
    public Music findMusicById(int id){
        return musicMapper.findMusicById(id);
    }
    public int deleteMusicById(int id){
        return musicMapper.deleteMusicById(id);
    }
    public Music findBylike(String title){
        return musicMapper.findBylike(title);
    }
    public List<Music> findAll(){
        return musicMapper.findAll();
    }

}
